<template>
  <el-radio-group v-model="select" @change="onChange">
    <el-radio :label="item.value" v-for="(item,index) in options" :key="index">{{item.label}}</el-radio>
  </el-radio-group>
</template>
<script>
export default {
    props: {
        value: {
            type: [String, Number, null],
            default: null
        },
    },
    watch: {
        value: {
            handler(nv) {
                this.select = nv;
            },
            immediate: true
        }
    },
    data() {
        return {
            select: null,
            options: [
                {label: '固定路线范围', value: 0},
                {label: '自定义路线范围', value: 1},
                {label: '按人员选择固定路线', value: 2},
                {label: '按排班选择固定路线', value: 3},
            ]
        }
    },
    methods: {
        onChange(e) {
            this.$emit('input', e)
        }
    }
}
</script>